import { uiwu } from "@/api/interface/interface"
import type { addSubAccountItf } from './type'

/** 子账号添加 **/
export const addSubAccountApi = async (data: Partial<addSubAccountItf>):Promise<any> => {
    return await uiwu.post({
        url: `fans/addSubAccount`,
        data
    })
}

/** 获取子账号列表 **/
export const getSubListApi = async (data: PageQuery):Promise<any> => {
    return await uiwu.get({
        url: `fans/getSubAccountList?page=` + data.page + '&limit=' + data.limit,
        data
    })
}

/** 子账号详情 **/
export const getSubInfoApi = async (data: number):Promise<any> => {
    return await uiwu.get({
        url: `fans/getSubAccountDetail/` + data,
    })
}

/** 子账号修改 **/
export const editSubInfoApi = async ( data: Partial<addSubAccountItf>, id: string ):Promise<any> => {
    return await uiwu.post({
        url: 'fans/editSubAccount/' + id,
        data
    })
}
